import { App } from "vue";
import { usePinia } from "@/store";

export const regPermission = (app: App<Element>) => {
  app.directive("permission", {
    //某个生命周期里面，判断当前store石佛有传入的value
    mounted(el, binding) {
      const useStore = usePinia();
      if (!useStore.permissions.includes(binding.value)) {
        el.remove();
      }
    },
  });
};
